//
//  WBDemoViewController.swift
//  个人微博
//
//  Created by 任聪聪 on 2017/5/24.
//  Copyright © 2017年 任孜聪. All rights reserved.
//

import UIKit

class WBDemoViewController: WBBaseViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "第\(navigationController?.childViewControllers.count ?? 0)个"
    }
    @objc fileprivate func showNext() {
        let vc = WBDemoViewController()
        navigationController?.pushViewController(vc, animated: true)
    }
}

extension WBDemoViewController{
    override func setUpUI() {
        //拖拽的时候会卡顿是因为没有对父类方法进行初始化
        super.setUpUI()
//        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", style: .plain, target: self, action: #selector(showNext))
//        let bn:UIButton = UIButton.cz_textButton("下一个", fontSize: 16, normalColor: UIColor.darkGray, highlightedColor: UIColor.orange)
//        bn.addTarget(self, action: #selector(showNext), for: .touchUpInside)
//        navigationItem.rightBarButtonItem = UIBarButtonItem(customView: bn)
        navBarItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", font: 16, any: self, action: #selector(showNext))
    }
}
